//
// knlvar.h
// Usage: Declare global kernel var
// Create Date: 2008-02-14
// Creator: MaJiuyue
//
#include "type.h"
#include "protect.h"
#include "Multiboot.h"

// Range of low memory
extern addr_t LOWMEM_START;
extern addr_t LOWMEM_END;

// Kernel end phyiscal address
extern addr_t KERNEL_END;

// Kernel reserved memory for self
extern addr_t KERNEL_RESERVED_START;
extern addr_t KERNEL_RESERVED_END;

// Kernel physical memory map end
extern addr_t PHYMAP_END;

// Range of VM
extern addr_t VMALLOC_START;
extern addr_t VMALLOC_END;

// Temporary kernel map base address
extern addr_t TKMAP_BASE;

// Persistent kernel map base address
extern addr_t PKMAP_BASE;

// Fix map base address
extern addr_t FIXADDR_BASE;

// Address of module
extern addr_t mods_addr;
// Count of module
extern int mods_count;

// Boot device
extern u32 boot_dev;

// Global PageDirectory
// kernel_pdt is defined at `linker.ld', address 0x100000
extern pde_t * KernelPDT;

/* Task Status Segment */
extern struct TSS tss;

/* Descriptor for GDT */
extern DESCRIPTOR GDT[GDT_SIZE];
extern GDTPointer GdtPtr;

